#include "cmainwindow.h"

#include <buola/widgets/cimagebox.h>
#include <buola/widgets/cstatusbar.h>

namespace buola { namespace show {

CMainWindow::CMainWindow()
{
    Resize(CSize_d(800,600));
    SetTitle(L"image viewer");

    mStatusBar=new gui::CStatusBar;
    mStatusBar->AddItem(L"0/0",nullptr,1);

    mImageBox=new gui::CImageBox;

    Attach(mStatusBar,gui::ATTACH_SOUTH,gui::ATTACH_STATUSBAR);
    Attach(mImageBox,gui::ATTACH_REPLACECLIENT);
}

CMainWindow::~CMainWindow()
{

}

void CMainWindow::Open(const io::CURI& pURI)
{
    img::CImage_rgb8 lImage;
    img::load(lImage,pURI);
    mImageBox->SetImage(std::move(lImage));
}

/*namespace show*/ } /*namespace buola*/ }
